{% extends "base.html" %}

{% block content %}
<div class="admin-dashboard container">
    <div class="admin-header">
        <h1>编辑用户</h1>
        <a href="{{ url_for('admin.manage_users') }}" class="btn">返回用户列表</a>
    </div>

    <div class="admin-form card">
        <form method="POST">
            {{ form.hidden_tag() }}
            <div class="form-group">
                {{ form.username.label }}
                {{ form.username(class="form-control") }}
                {% for error in form.username.errors %}
                <span class="error">{{ error }}</span>
                {% endfor %}
            </div>
            <div class="form-group">
                {{ form.email.label }}
                {{ form.email(class="form-control") }}
                {% for error in form.email.errors %}
                <span class="error">{{ error }}</span>
                {% endfor %}
            </div>
            <div class="form-group">
                {{ form.password.label }}
                {{ form.password(class="form-control") }}
                <small class="form-text text-muted">留空表示不修改密码</small>
                {% for error in form.password.errors %}
                <span class="error">{{ error }}</span>
                {% endfor %}
            </div>
            <div class="form-group checkbox">
                {{ form.is_admin() }} {{ form.is_admin.label }}
            </div>
            <div class="form-actions">
                <button type="submit" class="btn">保存修改</button>
            </div>
        </form>
    </div>
</div>
{% endblock %} 